//
//  C_addWLCell_2.m
//  Estate
//
//  Created by heyong on 16/6/12.
//  Copyright © 2016年 ttsx. All rights reserved.
//

#import "C_addWLCell_2.h"

@implementation C_addWLCell_2

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    self.title1.textColor= UIColorFromRGB(0x797979);
    self.title2.textColor= UIColorFromRGB(0x797979);
    self.title3.textColor= UIColorFromRGB(0x797979);
    self.title4.textColor= UIColorFromRGB(0x797979);
    self.lab1.textColor= UIColorFromRGB(0x797979);
    self.lab2.textColor= UIColorFromRGB(0x797979);
    self.lab3.textColor= UIColorFromRGB(0x797979);
    self.title1.font=[UIFont systemFontOfSize:16*BIZ];
    self.title2.font=[UIFont systemFontOfSize:16*BIZ];
    self.title3.font=[UIFont systemFontOfSize:16*BIZ];
    self.title4.font=[UIFont systemFontOfSize:16*BIZ];
    self.text_1.delegate=self;
    self.text_2.delegate=self;
    self.text_3.delegate=self;
    self.view1.backgroundColor=[UIColor colorWithRed:0.89 green:0.89 blue:0.90 alpha:1.00];
    self.view2.backgroundColor=[UIColor colorWithRed:0.89 green:0.89 blue:0.90 alpha:1.00];
    self.view3.backgroundColor=[UIColor colorWithRed:0.89 green:0.89 blue:0.90 alpha:1.00];
}
//设置分割线
- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor); CGContextFillRect(context, rect);
//    //上分割线，
//        CGContextSetStrokeColorWithColor(context, [UIColor grayColor].CGColor); CGContextStrokeRect(context, CGRectMake(0, -1, rect.size.width , 1));
    //下分割线
    CGContextSetStrokeColorWithColor(context,[UIColor colorWithRed:0.89 green:0.89 blue:0.90 alpha:1.00].CGColor); CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width, 1));
}

-(void) setText1:(NSString *)value1 andText2 :(NSString *)value2 andText3:(NSString *)value3{
    self.text_1.text=value1;
    self.text_2.text=value2;
    self.text_3.text=value3;
    self.text_1.font= [UIFont systemFontOfSize:16*BIZ];
    self.text_2.font= [UIFont systemFontOfSize:16*BIZ];
    self.text_3.font= [UIFont systemFontOfSize:16*BIZ];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)text_1Change:(UITextField *)sender {
    if(self.text1ChangeBlock){
        self.text1ChangeBlock(sender.text);
    }
}

- (IBAction)text_2_Change:(UITextField *)sender {
    if(self.text2ChangeBlock){
        self.text2ChangeBlock(sender.text);
    }
}

- (IBAction)text_3_Change:(UITextField *)sender {
    if(self.text3ChangeBlock){
        self.text3ChangeBlock(sender.text);
    }
}

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    //   限制苹果系统输入法  禁止输入表情
    if ([[[UITextInputMode currentInputMode]primaryLanguage] isEqualToString:@"emoji"]) {
        return NO;
    }
  
    return YES;
}

@end
